<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<%
	String parentId = request.getParameter("parentId");
	parentId = ( parentId == null ) ? "0" : parentId;
	String level = request.getParameter("level");
	String type = request.getParameter("type");
%>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>新增导航</title>
<link rel="stylesheet" type="text/css" href="../../jeasyui/themes/gray/easyui.css" />
<link rel="stylesheet" type="text/css" href="../../jeasyui/themes/icon.css" />
<link rel="stylesheet" type="text/css" href="../../css/manager.css" />

<script type="text/javascript" src="../../jeasyui/jquery-1.8.0.min.js"></script>
<script type="text/javascript" src="../../jeasyui/jquery.easyui.min.js"></script>
<script type="text/javascript" src="../../jeasyui/locale/easyui-lang-zh_CN.js"></script>
<script type="text/javascript">
	function initForm(){
		$('#fm').form({
			url : "nav.do?method=add",  
		    onSubmit: function(){
		        var name = $("#name").val();
		        if($.trim(name) == ""){
		        	$.messager.alert("提示",'<br />请输入名称！','info');
		        	return false;
		        }
		        var url = $("#url").val();
		        if($.trim(url) == ""){
		        	$.messager.alert("提示",'<br />请输入地址！','info');
		        	return false;
				}
		        return true;
		    },
		    success:function(msg){
		        if("success" == msg){
		        	parent.reloadDg();
		        } else {
		        	$.messager.alert('Warning','<br />' + msg);
		        }
		    }
		});  
	}
	
	$(function(){
		initForm();
	});
</script>
</head>
<body class="easyui-layout">
	<div data-options="region:'center',border:false">
		<form id="fm" method="post">
			<input type="hidden" name="parentId" value="<%=parentId %>">
			<input type="hidden" name="level" value="<%=level %>">
			<input type="hidden" name="type" value="<%=type %>">
			<div class="dg-content">
				<table style="" cellspacing="10px">
					<tr>
						<td align="right" style="padding-right: 5px;">名称</td>
						<td><input type='text' id="name" name="name" class='in-text' style="width: 250px"/>
							<font color="red">&nbsp;*</font>
						</td>
					</tr>
					<tr>
						<td align="right" style="padding-right: 5px;">地址</td>
						<td><input type='text' id="url" name="url" class='in-text' style="width: 250px" />
							<font color="red">&nbsp;*</font>
						</td>
					</tr>
					
					<tr>
						<td align="right" style="padding-right: 5px;">备注</td>
						<td>
							<textarea style="width: 250px; height: 50px;" name="remark"></textarea>
						</td>
					</tr>
				</table>
			</div>
		</form>
	</div>
	<div data-options="region:'south'" class='fm-btn'>
		<a href="#" class="easyui-linkbutton" iconCls="icon-ok" onclick="$('#fm').submit();">确定</a>
		<a href="#" class="easyui-linkbutton" iconCls="icon-cancel" onclick="parent.closeWin()">取消</a>
	</div>
</body>
</html>